package com.example.common.b_pojo;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @TableName musicarticle
 */
@TableName(value ="musicarticle")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Musicarticle implements Serializable {

    @TableId(value = "id",type = IdType.ASSIGN_ID)
    private Long id;

    private String summary;

    private String title;

    private String articleImg;

    private Integer isperfect;

    private Integer perfect;

    private Integer viewCounts;

    private Integer weight;

    private Long authorId;

    private Long bodyId;

    private Long categoryId;

    private Date createTime;

    private Date updateTime;

    @TableLogic
    private Integer isdelete;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Musicarticle other = (Musicarticle) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getSummary() == null ? other.getSummary() == null : this.getSummary().equals(other.getSummary()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getArticleImg() == null ? other.getArticleImg() == null : this.getArticleImg().equals(other.getArticleImg()))
            && (this.getIsperfect() == null ? other.getIsperfect() == null : this.getIsperfect().equals(other.getIsperfect()))
            && (this.getPerfect() == null ? other.getPerfect() == null : this.getPerfect().equals(other.getPerfect()))
            && (this.getViewCounts() == null ? other.getViewCounts() == null : this.getViewCounts().equals(other.getViewCounts()))
            && (this.getWeight() == null ? other.getWeight() == null : this.getWeight().equals(other.getWeight()))
            && (this.getAuthorId() == null ? other.getAuthorId() == null : this.getAuthorId().equals(other.getAuthorId()))
            && (this.getBodyId() == null ? other.getBodyId() == null : this.getBodyId().equals(other.getBodyId()))
            && (this.getCategoryId() == null ? other.getCategoryId() == null : this.getCategoryId().equals(other.getCategoryId()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getIsdelete() == null ? other.getIsdelete() == null : this.getIsdelete().equals(other.getIsdelete()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getSummary() == null) ? 0 : getSummary().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getArticleImg() == null) ? 0 : getArticleImg().hashCode());
        result = prime * result + ((getIsperfect() == null) ? 0 : getIsperfect().hashCode());
        result = prime * result + ((getPerfect() == null) ? 0 : getPerfect().hashCode());
        result = prime * result + ((getViewCounts() == null) ? 0 : getViewCounts().hashCode());
        result = prime * result + ((getWeight() == null) ? 0 : getWeight().hashCode());
        result = prime * result + ((getAuthorId() == null) ? 0 : getAuthorId().hashCode());
        result = prime * result + ((getBodyId() == null) ? 0 : getBodyId().hashCode());
        result = prime * result + ((getCategoryId() == null) ? 0 : getCategoryId().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getIsdelete() == null) ? 0 : getIsdelete().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", summary=").append(summary);
        sb.append(", title=").append(title);
        sb.append(", articleImg=").append(articleImg);
        sb.append(", isperfect=").append(isperfect);
        sb.append(", perfect=").append(perfect);
        sb.append(", viewCounts=").append(viewCounts);
        sb.append(", weight=").append(weight);
        sb.append(", authorId=").append(authorId);
        sb.append(", bodyId=").append(bodyId);
        sb.append(", categoryId=").append(categoryId);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", isdelete=").append(isdelete);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}